package com.ruoyi.edu.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.ruoyi.edu.mapper.EduCourseCollectMapper;
import com.ruoyi.edu.domain.EduCourseCollect;
import com.ruoyi.edu.service.IEduCourseCollectService;

import java.util.List;
import java.util.Map;

/**
 * 课程收藏Service业务层处理
 *
 * @author niruichen
 * @date 2020-12-22
 */
@Service
public class EduCourseCollectServiceImpl extends ServiceImpl<EduCourseCollectMapper, EduCourseCollect> implements IEduCourseCollectService {

    @Override
    public List<EduCourseCollect> queryList(EduCourseCollect eduCourseCollect) {
        LambdaQueryWrapper<EduCourseCollect> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(eduCourseCollect.getCourseId())){
            lqw.eq(EduCourseCollect::getCourseId ,eduCourseCollect.getCourseId());
        }
        if (StringUtils.isNotBlank(eduCourseCollect.getMemberId())){
            lqw.eq(EduCourseCollect::getMemberId ,eduCourseCollect.getMemberId());
        }
        return this.list(lqw);
    }
}
